package com.loveyukari.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.loveyukari.service.IpService;
import com.loveyukari.support.JsonResult;


/**
*
*yangshaohua
*2017年8月9日下午1:26:28
**/
@Controller
@RequestMapping("/admin/blackIp")
public class BlackIpController {
	
	private Logger log  = LoggerFactory.getLogger(BlackIpController.class);
	
	@Autowired
	private IpService ipService;
	
	@RequestMapping("/reload")
	@ResponseBody
	public JsonResult<Object> reload(){
		log.info("reload black ip");
		ipService.reload();
		return new JsonResult<Object>();
	}
	@RequestMapping("/reloadLogin/{flag}")
	@ResponseBody
	public JsonResult<Object> reloadLogin(@PathVariable boolean flag){
		log.info("reload login page");
		ipService.setLogigFlag(flag);
		return new JsonResult<Object>();
	}

}
